home *** CD-ROM | disk | FTP | other *** search
/ Compendium Deluxe 1 / LSD Compendium Deluxe 1.iso / a / programming / assemblers / cas.lha / fix.Z / fix / io.h < prev    next >
Encoding:
C/C++ Source or Header  |  1993-05-10  |  2.1 KB  |  89 lines

  1. typedef unsigned char byte;
  2. typedef unsigned short word;
  3.  
  4. extern FILE *OutF;
  5.  
  6. extern char InSeg;
  7. extern char **FileTab;
  8. extern int StartF, CurF;
  9. extern long Files;
  10.  
  11. #define TYPES 5
  12. #define SEG_TYPES 3
  13. typedef struct Segment *Segment;
  14. extern struct Segment {
  15.    int Type:8, Rel:1;
  16.    word Line, File, Base, Size;
  17.    long Loc;
  18. } SegTab[], *SegP;
  19. extern unsigned long LOC;
  20.  
  21. typedef struct Gap *Gap;
  22. extern struct Gap {
  23.    Segment Seg; word Offset, Size;
  24. } GapTab[], *GapP;
  25.  
  26. typedef struct Symbol *Symbol;
  27. struct Symbol {
  28.    char *Name; word Index;
  29.    int Global:1, Defined:1, Address:1, Variable:1, Map:1;
  30.    Segment Seg; word Offset;
  31.    Symbol Next[1];
  32. };
  33.  
  34. extern Symbol NIL;
  35. extern void SegInit(void);
  36. extern void StartSeg(byte Type, byte Rel, word Base);
  37. extern void EndSeg(void);
  38. extern void Space(word Rel);
  39. extern long SegTell(Segment Seg, word Offset);
  40.  
  41. extern void PByte(byte B);
  42. extern void PString(char *S);
  43.  
  44. extern void SymInit(void);
  45. extern char *CopyS(char *S);
  46. extern Symbol LookUp(char *Name);
  47. extern void RegInit(void);
  48.  
  49. typedef enum {
  50.    RB = 1, RW, DB, DW, ORG, SEG, END, GLOBAL, EXTERN, INCLUDE, IF, ELSE,
  51.    EQU, SET, LCURL, RCURL, LPAR, COMMA, SEMI,
  52.    SYMBOL, STRING, NUMBER, DOLLAR,
  53.    RPAR, COLON, QUEST,
  54.    NOT, NOT_NOT, HIGH, LOW, PLUS, MINUS, MULT, DIV, MOD,
  55.    LT, LE, GT, GE, EQ, NE, AND_AND, OR_OR,
  56.    AND, XOR, OR, SHL, SHR, DOT, BY,
  57.    AT, POUND, REGISTER, TYPE, MNEMONIC
  58. } Lexical;
  59. extern Lexical OldL;
  60.  
  61. typedef enum {
  62.    ACC, AB, CY, DPTR, PC, R0, R1, R2, R3, R4, R5, R6, R7
  63. } Register;
  64. typedef enum { CODE, XDATA, DATA, SFR, BIT } Type;
  65.  
  66. extern char Text[]; extern int Value;
  67. extern Symbol Sym;
  68. extern char InExp, InSemi;
  69.  
  70. extern int Line, StartLine;
  71. extern Lexical Scan(void);
  72. extern void ERROR(const char *Msg, ...);
  73. extern void FATAL(const char *Msg, ...);
  74. extern void CHECK(void);
  75. extern void *Allocate(unsigned Size);
  76.  
  77. extern byte GetB(FILE *FP);
  78. extern word GetW(FILE *FP);
  79. extern unsigned long GetL(FILE *FP);
  80. extern void PutB(byte B, FILE *FP);
  81. extern void PutW(word W, FILE *FP);
  82. extern void PutL(unsigned long L, FILE *FP);
  83.  
  84. extern void OpenF(char *Name);
  85.  
  86. extern struct AddrCard {
  87.    long Lo, Hi; byte ReadOnly;
  88. } AddrTab[];
  89.